import request from '@/utils/request';

// 查询商户列表
export function listMerchant(query: Record<string, any>) {
  return request({
    url: '/wms/merchant/list',
    method: 'get',
    params: query
  })
}

// 查询商户详细
export function getMerchant(merchantId: string | number) {
  return request({
    url: '/wms/merchant/' + merchantId,
    method: 'get'
  })
}

// 新增商户
export function addMerchant(data: Record<string, any>) {
  return request({
    url: '/wms/merchant',
    method: 'post',
    data: data
  })
}

// 修改商户
export function updateMerchant(data: Record<string, any>) {
  return request({
    url: '/wms/merchant',
    method: 'put',
    data: data
  })
}

// 删除商户
export function delMerchant(merchantId: string | number | string[]) {
  const ids = Array.isArray(merchantId) ? merchantId.join(',') : merchantId;
  return request({
    url: '/wms/merchant/' + ids,
    method: 'delete'
  })
}

// 导出商户
export function exportMerchant(query: Record<string, any>) {
  return request({
    url: '/wms/merchant/export',
    method: 'post',
    data: query
  })
}

// 获取商户下拉列表
export function getMerchantOptions() {
  return request({
    url: '/wms/merchant/listNoPage',
    method: 'get'
  })
}




